package com.maiji.cloud.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@NoArgsConstructor
@Data
@Accessors(chain=true)
public class BaseOutPutDto<T>{

    @ApiModelProperty(value="返回的数据")
    private T data;

    @ApiModelProperty(value="响应状态",required = true)
    private Status status = Status.SUCCESS;
    @ApiModelProperty(value="响应信息",required = true)
    private String message;

    @ApiModelProperty(value="分页信息")
    private ResMetaData resMetaData;

    public BaseOutPutDto(Status status) {
        this.status = status;
        this.message = status.getMessage();
    }

    public void setStatus(Status status) {
        this.status = status;
        this.message = status.getMessage();
    }
}
